package com.adcage.ojudgebackendserviceclient.service;

import com.adcage.ojudgebackendmodel.entity.Question;
import com.adcage.ojudgebackendmodel.entity.QuestionSubmit;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author l1577
 * @description 针对表【question(题目)】的数据库操作Service
 * @createDate 2025-06-18 16:05:52
 */
@FeignClient(name = "oJudge-backend-question-service", path = "/api/question/inner")
public interface QuestionFeignClient {

    /**
     * 获取题目
     *
     * @param id
     * @return
     */
    @GetMapping("/get/id")
    Question getById(@RequestParam("id") long id);

    /**
     * 获取提交
     *
     * @param questionSubmitId
     * @return
     */
    @GetMapping("/question_submit/get/id")
    QuestionSubmit getQuestionSubmitById(@RequestParam("questionSubmitId") long questionSubmitId);

    /**
     * 更新提交
     *
     * @param questionSubmit
     * @return
     */
    @PostMapping("/question_submit/update")
    boolean updateQuestionSubmitById(@RequestBody QuestionSubmit questionSubmit);

}
